﻿#pragma once
#include "ZuiLib.h"
#include "luaobj/Luaobj.h"

namespace ZuiLib {

class LApplication :public LuaClass<ZApplication>
{
public:
	static this_t* instance()
	{
		return ZApplication::Instance();
	}

	int quit(LuaFuncState& L)
	{
		pThis->Quit();
		return 0;
	}

	int getFrameRate(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetFrameRate());
	}

	int getFrameCount(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetFrameCount());
	}

	int getMainThreadID(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetMainThreadID());
	}

	int isBackground(LuaFuncState& L)
	{
		return L.lreturn(pThis->IsBackground());
	}
	
	int getPlatform(LuaFuncState& L)
	{
		return L.lreturn(pThis->GetPlatform());
	}

	BEGIN_MAP_FUNC(LApplication)
	DECLARE_FUNC(quit),
	DECLARE_FUNC(getFrameRate),
	DECLARE_FUNC(getFrameCount),
	DECLARE_FUNC(getMainThreadID),
	DECLARE_FUNC(isBackground),
	DECLARE_FUNC(getPlatform),
	END_MAP_FUNC
};




}//namespace


